<template>
  <div>
    <svg aria-hidden="true" :style="getStyle">
      <use :xlink:href="`#icon-${iconName}`" :fill="fill" />
    </svg>
  </div>
</template>
<script>
import "@/utils/iconfont.js";
import { computed } from "vue";
export default {
  name: "iconSvg",
  props: {
    iconName: {
      type: String,
      required: true,
    },
    w: {
      type: [String, Number],
      default: "18",
    },
    h: {
      type: [String, Number],
      default: "18",
    },
    fill: {
      type: String,
    },
  },
  setup(props) {
    let getStyle = computed(() => {
      let styleMap = {
        width: `${props.w}px`,
        height: `${props.h}px`,
      };
      return styleMap;
    });
    return {
      getStyle,
    };
  },
};
</script>
